package main

import (
	"app/app/router"
	"app/configs"
	"app/dao"
	"flag"
	"fmt"

	"gorm.io/gorm"
)

var configFile = flag.String("config", "./config.yaml", "配置文件路径")

func init() {
	flag.Parse()

	conf := configs.Init(*configFile)

	gormConf := &gorm.Config{}

	// 连接数据库
	if err := dao.OpenDB(conf.MySqlUrl, gormConf, 10, 20); err != nil {
		fmt.Println(err)
	}
}

func main() {
	router.InitRouter()
}
